Skip to content

Fix browser SyntaxError on the SSE [DONE] sentinel - #2

Merged
ankamteja merged 1 commit into
mainfrom
feat/rag-web
Aug 20, 2026
Merged

Fix browser SyntaxError on the SSE [DONE] sentinel#2
ankamteja merged 1 commit into
mainfrom
feat/rag-web

Conversation

@ankamteja

Copy link
Copy Markdown
Owner

The stream ends with data: [DONE], which is not JSON. The page fed every data line to JSON.parse, so the sentinel threw "Unexpected token 'D'" and the caught error was painted red under an otherwise complete answer. The fix skips the [DONE] line (and any empty data line) before parsing. Adds a regression test; full suite 60 passing. Verified live on device.

The stream ends with `data: [DONE]`, which is not JSON. The page fed every
data line to JSON.parse, so the sentinel threw "Unexpected token 'D'" and the
caught error was painted red under an otherwise complete answer. Skip the
[DONE] line (and any empty data line) before parsing.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3944d1cb-622b-48ec-83ad-7a9a5f7a408a


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ankamteja
ankamteja merged commit 4fc14fa into main Aug 20, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant